var saveChildToTree = function () {
	var key = Ext.getCmp("JSONxEdit_FormPanel_editorForm_key").getValue();
	var value = Ext.getCmp("JSONxEdit_FormPanel_editorForm_value").getValue();
	var isNull = Ext.getCmp("JSONxEdit_FormPanel_editorForm_isNull").getValue();
	var nodeId = Ext.getCmp("JSONxEdit_FormPanel_editorForm_keyId").getValue();
	var idArray = nodeId.split("_");

	var treeId = key + '_' + idArray[1] + '_' + idArray[2];

	var node = JSONxEdit_jsonTree.getNodeById( nodeId );

	debug.trace("isNull == "+isNull);
	if (isNull)
	{
		value = "null";
		node.attributes.type = "null";
	}
	else
	{
		if ( !isNaN(value) && !isString(value) && value != null )
			node.attributes.type = "number";
		else
			node.attributes.type = "string";
	}

	node.setId ( treeId );
	node.setText ( key );

	node.attributes.value = value;

	Ext.getCmp("JSONxEdit_FormPanel_editorForm_keyId").setValue ( treeId );
};

var saveParentToTree = function ()  {
	var index = Ext.getCmp("JSONxEdit_FormPanel_editorObjectForm_index").getValue();
	var nodeId = Ext.getCmp("JSONxEdit_FormPanel_editorObjectForm_indexId").getValue();
	var idArray = nodeId.split("_");

	var treeId = index + '_' + idArray[1] + '_' + idArray[2];

	var node = JSONxEdit_jsonTree.getNodeById( nodeId );
	node.setId ( treeId );
	node.setText ( index );

	Ext.getCmp("JSONxEdit_FormPanel_editorObjectForm_indexId").setValue ( treeId );
};

var saveJsonPartToTree = function ()  {

};



var disableEditor = function () {
	JSONxEdit_jsonEditorForm.disable();
	JSONxEdit_jsonEditorObjectForm.disable();
	JSONxEdit_jsonPartForm.disable();

	JSONxEdit_jsonEditorTabPanel.setActiveTab(0);
};
